﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="TCMeta.aspx.cs" Inherits="IMPPFront.Management.TCMeta" %>
<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <ext:Store ID="TCRStore" runat="server" AutoSave="true" OnBeforeStoreChanged="HandleRefCodeChanges" 
    SkipIdForNewRecords="false" RefreshAfterSaving="Auto" OnRefreshData="TCRStore_Refresh">
        <Reader>
            <ext:JsonReader IDProperty="idRefCodeDetail">
                <Fields>
                    <ext:RecordField Name="idRefCodeDetail" />
                    <ext:RecordField Name="idRefCode" Type="Int" DefaultValue="106" />
                    <ext:RecordField Name="refCodeDetail" DefaultValue="0"/>
                    <ext:RecordField Name="Description" AllowBlank="false" />
                    <ext:RecordField Name="ShortDescription" AllowBlank="false" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <Listeners>
            <Exception Handler="
                Ext.net.Notification.show({
                    iconCls    : 'icon-exclamation', 
                    html       : e.message, 
                    title      : 'EXCEPTION', 
                    autoScroll : true, 
                    hideDelay  : 5000, 
                    width      : 300, 
                    height     : 200
                });" />
            <BeforeSave Handler="var valid = true; this.each(function(r){if(r.dirty && !r.isValid()){valid=false;}}); return valid;" />
        </Listeners>
    </ext:Store>
    <ext:Store ID="TCRCombo" runat="server">
        <Reader>
            <ext:JsonReader IDProperty="refCodeDetail">
                <Fields>
                    <ext:RecordField Name="idRefCodeDetail" />
                    <ext:RecordField Name="refCodeDetail" />
                    <ext:RecordField Name="Description" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
     <ext:Store ID="TCCStore" runat="server" AutoSave="true" OnBeforeStoreChanged="HandleRefCodeChanges" 
    SkipIdForNewRecords="false" RefreshAfterSaving="Auto" OnRefreshData="TCCStore_Refresh">
        <Reader>
            <ext:JsonReader IDProperty="idRefCodeDetail">
                <Fields>
                    <ext:RecordField Name="idRefCodeDetail" />
                    <ext:RecordField Name="idRefCode" Type="Int" DefaultValue="115" />
                    <ext:RecordField Name="refCodeDetail" DefaultValue="0"/>
                    <ext:RecordField Name="Description" AllowBlank="false" />
                    <ext:RecordField Name="ShortDescription" AllowBlank="false" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <Listeners>
            <Exception Handler="
                Ext.net.Notification.show({
                    iconCls    : 'icon-exclamation', 
                    html       : e.message, 
                    title      : 'EXCEPTION', 
                    autoScroll : true, 
                    hideDelay  : 5000, 
                    width      : 300, 
                    height     : 200
                });" />
            <BeforeSave Handler="var valid = true; this.each(function(r){if(r.dirty && !r.isValid()){valid=false;}}); return valid;" />
        </Listeners>
    </ext:Store>
    <ext:Store ID="TCCCombo" runat="server">
        <Reader>
            <ext:JsonReader IDProperty="refCodeDetail">
                <Fields>
                    <ext:RecordField Name="idRefCodeDetail" />
                    <ext:RecordField Name="refCodeDetail" />
                    <ext:RecordField Name="Description" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
     <ext:Store ID="TCGStore" runat="server" AutoSave="true" OnBeforeStoreChanged="HandleRefCodeChanges" 
    SkipIdForNewRecords="false" RefreshAfterSaving="Auto" OnRefreshData="TCGStore_Refresh">
        <Reader>
            <ext:JsonReader IDProperty="idRefCodeDetail">
                <Fields>
                    <ext:RecordField Name="idRefCodeDetail" />
                    <ext:RecordField Name="idRefCode" Type="Int" DefaultValue="116" />
                    <ext:RecordField Name="refCodeDetail" DefaultValue="0"/>
                    <ext:RecordField Name="Description" AllowBlank="false" />
                    <ext:RecordField Name="ShortDescription" AllowBlank="false" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <Listeners>
            <Exception Handler="
                Ext.net.Notification.show({
                    iconCls    : 'icon-exclamation', 
                    html       : e.message, 
                    title      : 'EXCEPTION', 
                    autoScroll : true, 
                    hideDelay  : 5000, 
                    width      : 300, 
                    height     : 200
                });" />
            <BeforeSave Handler="var valid = true; this.each(function(r){if(r.dirty && !r.isValid()){valid=false;}}); return valid;" />
        </Listeners>
    </ext:Store>
    <ext:Store ID="TCGCombo" runat="server">
        <Reader>
            <ext:JsonReader IDProperty="refCodeDetail">
                <Fields>
                    <ext:RecordField Name="idRefCodeDetail" />
                    <ext:RecordField Name="refCodeDetail" />
                    <ext:RecordField Name="Description" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Panel ID="MainPanel" runat="server" Frame="false" Border="false">
        <Items>
            <ext:Image ID="Image1" runat="server" ImageUrl="~/Images/LogoHH.png" Width="192" />
            <ext:Container ID="RootContainer" runat="server" Layout="VBoxLayout" Height="440">
                <LayoutConfig>
                    <ext:VBoxLayoutConfig Align="Stretch" />
                </LayoutConfig>
                <Items>
                <ext:Container ID="FirstRowContainer" runat="server" Layout="HBoxLayout" Flex="1">
                <LayoutConfig>
                    <ext:HBoxLayoutConfig Padding="0 0 5 0" Align="Stretch" />
                </LayoutConfig>
                <Items>
            <ext:GridPanel runat="server" ID="TCRefPanel" Margins="0 2 0 15" Flex="1" Title="Technische competentie referenties" Height="220" AutoScroll="true" StoreID="TCRStore">
                <TopBar>
                    <ext:Toolbar runat="server" ID="TCRToolbar">
                        <Items>
                            <ext:Button runat="server" ID="AddTCRButton" Icon="Add" Text="Referentie">
                                <Listeners>
                                    <Click Handler="#{TCRefPanel}.insertRecord();" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="DeleteTCRButton" runat="server" Text="Delete" Icon="Exclamation">
                                <Listeners>
                                    <Click Handler="#{TCRefPanel}.deleteSelected();" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="Button1" runat="server" Text="Save" Icon="Disk">
                                <Listeners>
                                    <Click Handler="#{TCRefPanel}.save();" />
                                </Listeners>
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <ColumnModel runat="server" ID="TCRefModel">
                    <Columns>
                        <ext:Column Header="Id" DataIndex="idRefCodeDetail" />
                        <ext:Column Header="RefCode" DataIndex="idRefCode" />
                        <ext:Column Header="Omschrijving" DataIndex="Description" >
                            <Editor>
                                <ext:TextField runat="server" ID="TCRDescField" />
                            </Editor>
                        </ext:Column>
                        <ext:Column Header="Korte omschrijving" DataIndex="ShortDescription">
                            <Editor>
                                <ext:TextField runat="server" ID="TCRShortDescField" />
                            </Editor>
                        </ext:Column>
                    </Columns>
                </ColumnModel>
                <SelectionModel>
                    <ext:RowSelectionModel ID="TCRefSelectionModel" runat="server" />
                </SelectionModel>
                <LoadMask ShowMask="true" />
                <BottomBar>
                    <ext:PagingToolbar ID="TCRefPagingTB" runat="server" PageSize="5" />
                </BottomBar>
            </ext:GridPanel>
            <ext:GridPanel runat="server" ID="TCCRefPanel" Margins="0 15 0 2" Flex="1" Title="Technische competentie clusters" Height="220" AutoScroll="true" StoreID="TCCStore">
                <TopBar>
                    <ext:Toolbar runat="server" ID="TCCRefTB">
                        <Items>
                            <ext:Button runat="server" ID="TCCAddButton" Icon="Add" Text="Cluster">
                                <Listeners>
                                    <Click Handler="#{TCCRefPanel}.insertRecord();" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="TCCDeleteButton" runat="server" Text="Delete" Icon="Exclamation">
                                <Listeners>
                                    <Click Handler="#{TCCRefPanel}.deleteSelected();" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="TCCSaveButton" runat="server" Text="Save" Icon="Disk">
                                <Listeners>
                                    <Click Handler="#{TCCRefPanel}.save();" />
                                </Listeners>
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <ColumnModel runat="server" ID="TCCRefModel">
                    <Columns>
                        <ext:Column Header="Id" DataIndex="idRefCodeDetail" />
                        <ext:Column Header="RefCode" DataIndex="idRefCode" />
                        <ext:Column Header="Omschrijving" DataIndex="Description" >
                            <Editor>
                                <ext:TextField runat="server" ID="TCCDescTF" />
                            </Editor>
                        </ext:Column>
                        <ext:Column Header="Korte omschrijving" DataIndex="ShortDescription">
                            <Editor>
                                <ext:TextField runat="server" ID="TCCShortDescTF" />
                            </Editor>
                        </ext:Column>
                    </Columns>
                </ColumnModel>
                <SelectionModel>
                    <ext:RowSelectionModel ID="TCCRefSM" runat="server" />
                </SelectionModel>
                <LoadMask ShowMask="true" />
                <BottomBar>
                    <ext:PagingToolbar ID="TCCRefPB" runat="server" PageSize="5" />
                </BottomBar>
            </ext:GridPanel>
            </Items>
            </ext:Container>
            <ext:Container ID="SecondRowContainer" runat="server" Layout="HBoxLayout" Flex="1">
                <LayoutConfig>
                    <ext:HBoxLayoutConfig Padding="0 0 5 0" Align="Stretch" />
                </LayoutConfig>
                <Items>
            <ext:GridPanel runat="server" ID="TCGRefPanel" Flex="1" Margins="0 15 0 15" Title="Technische competentie gidsen" Height="220" AutoScroll="true" StoreID="TCGStore">
                <TopBar>
                    <ext:Toolbar runat="server" ID="Toolbar1">
                        <Items>
                            <ext:Button runat="server" ID="Button5" Icon="Add" Text="Gids">
                                <Listeners>
                                    <Click Handler="#{TCGRefPanel}.insertRecord();" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="Button6" runat="server" Text="Delete" Icon="Exclamation">
                                <Listeners>
                                    <Click Handler="#{TCGRefPanel}.deleteSelected();" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="Button7" runat="server" Text="Save" Icon="Disk">
                                <Listeners>
                                    <Click Handler="#{TCGRefPanel}.save();" />
                                </Listeners>
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <ColumnModel runat="server" ID="TCGRefCM">
                    <Columns>
                        <ext:Column Header="Id" DataIndex="idRefCodeDetail" />
                        <ext:Column Header="RefCode" DataIndex="idRefCode" />
                        <ext:Column Header="Omschrijving" DataIndex="Description" >
                            <Editor>
                                <ext:TextField runat="server" ID="NTCGDescTF" />
                            </Editor>
                        </ext:Column>
                        <ext:Column Header="Korte omschrijving" DataIndex="ShortDescription">
                            <Editor>
                                <ext:TextField runat="server" ID="TCGShortDescTF" />
                            </Editor>
                        </ext:Column>
                    </Columns>
                </ColumnModel>
                <SelectionModel>
                    <ext:RowSelectionModel ID="TCGRefSM" runat="server" />
                </SelectionModel>
                <LoadMask ShowMask="true" />
                <BottomBar>
                    <ext:PagingToolbar ID="TCGRefPT" runat="server" PageSize="5" />
                </BottomBar>
            </ext:GridPanel>
            </Items>
            </ext:Container>
            </Items>
            </ext:Container>
            <ext:Container ID="Container1" runat="server" Layout="VBoxLayout" Height="400">
                <LayoutConfig>
                    <ext:VBoxLayoutConfig Align="Stretch" />
                </LayoutConfig>
                <Items>
            <ext:GridPanel runat="server" ID="TCPanel" Margins="0 15 0 15" Title="Technische competenties"  AutoHeight="true" AutoScroll="true">
                <TopBar>
                    <ext:Toolbar runat="server" ID="TCToolbar">
                        <Items>
                            <ext:Button runat="server" ID="AddTCButton" Icon="Add" Text="Technische competentie">
                                <Listeners>
                                    <Click Handler="#{TCPanel}.insertRecord();" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="Button2" runat="server" Text="Delete" Icon="Exclamation">
                                <Listeners>
                                    <Click Handler="#{TCPanel}.deleteSelected();" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="Button3" runat="server" Text="Save" Icon="Disk">
                                <Listeners>
                                    <Click Handler="#{FRTCPanel}.save();" />
                                </Listeners>
                            </ext:Button>
                            <ext:Button ID="GidsAddButton" runat="server" Text="Gidsen" Icon="ReportEdit">
                                <DirectEvents>
                                    <Click OnEvent="GidsAddButton_Clicked">
                                        <EventMask ShowMask="true" Msg="Laden..." />
                                    </Click>
                                </DirectEvents>
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <Store>
                    <ext:Store ID="TCStore" runat="server" AutoSave="true" OnBeforeStoreChanged="HandleChanges" SkipIdForNewRecords="false"
                                RefreshAfterSaving="None">                                          
                        <Reader>
                            <ext:JsonReader IDProperty="idCompetentie">
                                <Fields>
                                    <ext:RecordField Name="idCompetentie" />
                                    <ext:RecordField Name="Type" AllowBlank="false" DefaultValue="1" />
                                    <ext:RecordField Name="Cluster" AllowBlank="false" />
                                    <ext:RecordField Name="Competentie" AllowBlank="false" />                                   
                                    <ext:RecordField Name="Niveau" AllowBlank="false" />
                                </Fields>
                            </ext:JsonReader>
                        </Reader>
                        <Listeners>
                            <Exception Handler="
                                Ext.net.Notification.show({
                                    iconCls    : 'icon-exclamation', 
                                    html       : e.message, 
                                    title      : 'EXCEPTION', 
                                    autoScroll : true, 
                                    hideDelay  : 5000, 
                                    width      : 300, 
                                    height     : 200
                                });" />
                            <BeforeSave Handler="var valid = true; this.each(function(r){if(r.dirty && !r.isValid()){valid=false;}}); return valid;" />
                        </Listeners>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server" ID="TCModel">
                    <Columns>
                        <ext:Column Header="Id" DataIndex="idCompetentie" />
                        <ext:Column Header="Cluster" DataIndex="Cluster">
                            <Renderer Fn="clusterRenderer" />
                            <Editor>
                                <ext:ComboBox ID="ClusterComboBox" runat="server" Editable="false" DisplayField="Description" ValueField="refCodeDetail"
                                 ForceSelection="true" EmptyText="Selecter een cluster..." StoreID="TCCCombo" />
                            </Editor>
                        </ext:Column>
                        <ext:Column Header="Competentie" DataIndex="Competentie">
                            <Renderer Fn="competentieRenderer" />
                            <Editor>
                                <ext:ComboBox ID="CompetentieComboBox" runat="server" Editable="false" DisplayField="Description" ValueField="refCodeDetail"
                                 ForceSelection="true" EmptyText="Selecteer een competentie..." StoreID="TCRCombo" />
                            </Editor>
                        </ext:Column>
                        <ext:RatingColumn DataIndex="Niveau" Editable="true" RoundToTick="true" MaxRating="3" />
                    </Columns>
                </ColumnModel>
                <SelectionModel>
                    <ext:RowSelectionModel ID="TCSelectionModel" runat="server" />
                </SelectionModel>
                <LoadMask ShowMask="true" />
                <BottomBar>
                    <ext:PagingToolbar ID="TCPagingToolbar" runat="server" PageSize="10" />
                </BottomBar>
            </ext:GridPanel>
            </Items>
            </ext:Container>
        </Items>
    </ext:Panel>
    <ext:Hidden ID="GidsIdCompetentie" runat="server" />
     <ext:Window ID="GidsAddWindow" 
            runat="server" 
            ShowOnLoad="false" Hidden="true"
            Closable="true"
            Height="400"
            Width="300"
            Icon="WorldAdd"
            Title="Gidsen"
            Padding="5"
            BodyBorder="false">
            <Items>
                
                <ext:ColumnLayout ID="ColumnLayout1" runat="server" FitHeight="true">
                    <Columns>
                        <ext:LayoutColumn ColumnWidth="0.5">
                           <ext:GridPanel 
                                ID="AvailableGidsenPanel" 
                                runat="server" 
                                EnableDragDrop="true"
                                AutoExpandColumn="Description">
                                <ColumnModel ID="ColumnModel1" runat="server">
	                                <Columns>
                                        <ext:Column ColumnID="Description" Header="Beschikbare gidsen" DataIndex="Description" />                   
	                                </Columns>
                                </ColumnModel>
                                <SelectionModel>
                                    <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
                                </SelectionModel>
                                <Store>
                                    <ext:Store ID="AvailableGidsenStore" runat="server" AutoSave="false">                                          
                                        <Reader>
                                            <ext:JsonReader IDProperty="idRefCodeDetail">
                                                <Fields>
                                                    <ext:RecordField Name="idRefCodeDetail" />
                                                    <ext:RecordField Name="idRefCode" Type="Int" DefaultValue="115" />
                                                    <ext:RecordField Name="refCodeDetail" DefaultValue="0"/>
                                                    <ext:RecordField Name="Description" AllowBlank="false" />
                                                    <ext:RecordField Name="ShortDescription" AllowBlank="false" />
                                                </Fields>
                                            </ext:JsonReader>
                                        </Reader>
                                    </ext:Store>
                                </Store>
                            </ext:GridPanel>
                        </ext:LayoutColumn>
                        <ext:LayoutColumn>
                            <ext:Panel ID="Panel1" 
                                runat="server" 
                                Width="35" 
                                BodyStyle="background-color: transparent;" 
                                Border="false" 
                                Layout="Anchor">
                                <Items>
                                    <ext:Panel ID="Panel2" runat="server" Border="false" BodyStyle="background-color: transparent;" AnchorVertical="40%" />
                                    <ext:Panel ID="Panel3" runat="server" Border="false" BodyStyle="background-color: transparent;" Padding="5">
                                        <Items>
                                            <ext:Button ID="Button4" runat="server" Icon="ResultsetNext" StyleSpec="margin-bottom:2px;">
                                                <Listeners>
                                                    <Click Handler="GidsenSelector.add();" />
                                                </Listeners>
                                                <ToolTips>
                                                    <ext:ToolTip ID="ToolTip1" runat="server" Title="Add" Html="Add Selected Rows" />
                                                </ToolTips>
                                            </ext:Button>
                                            <ext:Button ID="Button8" runat="server" Icon="ResultsetLast" StyleSpec="margin-bottom:2px;">
                                                <Listeners>
                                                    <Click Handler="GidsenSelector.addAll();" />
                                                </Listeners>
                                                <ToolTips>
                                                    <ext:ToolTip ID="ToolTip2" runat="server" Title="Add all" Html="Add All Rows" />
                                                </ToolTips>
                                            </ext:Button>
                                            <ext:Button ID="Button9" runat="server" Icon="ResultsetPrevious" StyleSpec="margin-bottom:2px;">
                                                <Listeners>
                                                    <Click Handler="GidsenSelector.remove(MainContent_AvailableGidsenPanel, MainContent_SubmitGidsenPanel);" />
                                                </Listeners>
                                                <ToolTips>
                                                    <ext:ToolTip ID="ToolTip3" runat="server" Title="Remove" Html="Remove Selected Rows" />
                                                </ToolTips>
                                            </ext:Button>
                                            <ext:Button ID="Button10" runat="server" Icon="ResultsetFirst" StyleSpec="margin-bottom:2px;">
                                                <Listeners>
                                                    <Click Handler="GidsenSelector.removeAll(MainContent_AvailableGidsenPanel, MainContent_SubmitGidsenPanel);" />
                                                </Listeners>
                                                <ToolTips>
                                                    <ext:ToolTip ID="ToolTip4" runat="server" Title="Remove all" Html="Remove All Rows" />
                                                </ToolTips>
                                            </ext:Button>
                                        </Items>
                                    </ext:Panel>
                                </Items>
                            </ext:Panel>
                        </ext:LayoutColumn>
                        <ext:LayoutColumn ColumnWidth="0.5">
                            <ext:GridPanel 
                                ID="SubmitGidsenPanel" 
                                runat="server" 
                                EnableDragDrop="false"
                                AutoExpandColumn="Description">
                                <Listeners>
                                </Listeners>
                                <ColumnModel ID="ColumnModel2" runat="server">
	                                <Columns>
                                        <ext:Column ColumnID="Description" Header="Geselecteerde gidsen" DataIndex="Description" />                   
	                                </Columns>
                                </ColumnModel>
                                <SelectionModel>
                                    <ext:RowSelectionModel ID="RowSelectionModel2" runat="server" />
                                </SelectionModel>
                                <Store>
                                    <ext:Store ID="SubmitGidsenStore" runat="server" OnBeforeStoreChanged="HandleGidsChanges" SkipIdForNewRecords="false"
                                RefreshAfterSaving="None" >                                          
                                        <Reader>
                                            <ext:JsonReader IDProperty="idRefCodeDetail">
                                                <Fields>
                                                    <ext:RecordField Name="idRefCodeDetail" />
                                                    <ext:RecordField Name="idRefCode" Type="Int" DefaultValue="115" />
                                                    <ext:RecordField Name="refCodeDetail" DefaultValue="0"/>
                                                    <ext:RecordField Name="Description" AllowBlank="false" />
                                                    <ext:RecordField Name="ShortDescription" AllowBlank="false" />
                                                </Fields>
                                            </ext:JsonReader>
                                        </Reader>
                                        <Listeners>
                                            <Exception Handler="
                                                Ext.net.Notification.show({
                                                    iconCls    : 'icon-exclamation', 
                                                    html       : e.message, 
                                                    title      : 'EXCEPTION', 
                                                    autoScroll : true, 
                                                    hideDelay  : 5000, 
                                                    width      : 300, 
                                                    height     : 200
                                                });" />
                                            <BeforeSave Handler="var valid = true; this.each(function(r){if(r.dirty && !r.isValid()){valid=false;}}); return valid;" />
                                        </Listeners>
                                    </ext:Store>
                                </Store>
                                <LoadMask ShowMask="true" />  
                                <SaveMask ShowMask="true" />
                            </ext:GridPanel>
                        </ext:LayoutColumn>
                    </Columns>
                </ext:ColumnLayout>              
            </Items>  
            <Buttons>
                <ext:Button ID="Button11" runat="server" Text="Bewaar gidsen" Icon="Disk">
                    <Listeners>
                        <Click Handler="#{SubmitGidsenPanel}.save();" />
                    </Listeners>
                </ext:Button>
            </Buttons>
            </ext:Window>
            
    <script type="text/javascript">
        var clusterRenderer = function (value) {
            var r = MainContent_TCCCombo.getById(value);

            if (Ext.isEmpty(r)) {
                return "";
            }

            return r.data.Description;
        };

        var competentieRenderer = function (value) {
            var r = MainContent_TCRCombo.getById(value);

            if (Ext.isEmpty(r)) {
                return "";
            }

            return r.data.Description;
        };

        var GidsenSelector = {
            add: function (source, destination) {
                source = source || MainContent_AvailableGidsenPanel;
                destination = destination || MainContent_SubmitGidsenPanel;
                if (source.hasSelection()) {
                    var records = source.selModel.getSelections();
                    source.deleteSelected();
                    Ext.each(records, function (record) {
                        destination.store.insert(0, record);
                    });
                }
            },
            addAll: function (source, destination) {
                source = source || MainContent_AvailableGidsenPanel;
                destination = destination || MainContent_SubmitGidsenPanel;
                var records = source.store.getRange();
                source.store.removeAll();
                Ext.each(records, function (record) {
                    destination.store.insert(record);
                });
            },
            remove: function (source, destination) {
                this.add(destination, source);
            },
            removeAll: function (source, destination) {
                this.addAll(destination, source);
            }
        };
    </script>
</asp:Content>
